// Package utils Context工具包
package utils

import (
	"context"
	"time"
)

// TimeoutContext 创建超时Context
func TimeoutContext(duration time.Duration) (context.Context, context.CancelFunc) {
	//设置超时时间
	ctx := context.Background()
	ctxTimeout, cancel := context.WithTimeout(ctx, duration)
	return ctxTimeout, cancel
}
